﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Xmeta.Test.Common
{
    public class Utils
    {
        public static string GetTimeStamp()
        {
            //DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
            //DateTime dtNow = DateTime.Parse(DateTime.Now.ToString());
            //TimeSpan toNow = dtNow.Subtract(dtStart);
            //string timeStamp = toNow.Ticks.ToString();
            //return timeStamp.Substring(0, timeStamp.Length - 7);
            return ((DateTime.Now.Ticks - TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)).Ticks) / 10000).ToString();
        }

        /// <summary>
        /// 获取盲盒加工ID
        /// </summary>
        /// <param name="goodsId"></param>
        /// <returns></returns>
        public static string GetBoxGoodId(string goodsId)
        {

            return goodsId + "_1";
        }

        /// <summary>
        /// 获取原始goodids
        /// </summary>
        /// <param name="goodsId"></param>
        /// <returns></returns>
        public static string GetGoodId(string goodsId)
        {

            return goodsId.Replace("_1", "");
        }
    }
}
